<template>
  <el-dialog :title="'优惠'" :close-on-click-modal="false" :visible.sync="visible" class="cu-dialog cu-dialog_center"
    lock-scroll width="500px">
    <el-row :gutter="15" class="">
      <el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right"
        :disabled="!!isDetail" :rules="rules">
        <el-col :span="24">
          <el-form-item label="证书模版" prop="certTypeId">
            <el-select v-model="dataForm.certTypeId" placeholder="请选择" clearable required :style="{ width: '100%' }"
              filterable lastLevel>
              <el-option-group v-for="group in certificateTemplateOptions" :key="group.id" :label="group.fullName">
                <el-option v-for="item in group.children" :key="item.id" :label="item.fullName"
                  :value="item.enCode"></el-option>
              </el-option-group>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="参训状态" prop="status">
            <el-checkbox-group v-model="dataForm.status">
              <el-checkbox-button v-for="(item, index) in statusOptions" :key="item.enCode"
                :label="item.enCode">{{ item.fullName }}</el-checkbox-button>
            </el-checkbox-group>
          </el-form-item>
        </el-col>

        <el-col :span="24">
          <el-form-item label="优惠金额" prop="deductionAmount">
            <el-input-number v-model="dataForm.deductionAmount" placeholder="数字文本" required :step="1"
              controls-position="right" :style="{ width: '100%' }"></el-input-number>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="备注" prop="description">
            <el-input v-model="dataForm.description" placeholder="请输入" show-word-limit :style="{ width: '100%' }"
              type="textarea" :autosize="{ minRows: 4, maxRows: 4 }"></el-input>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取 消</el-button>
      <el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail">确 定</el-button>
    </span>
  </el-dialog>
</template>
<script>
export { default } from '../DeductionForm/index.js'
</script>
<style scoped>
.el-time-spinner__wrapper {
  width: 100% !important;
}
@import url(index.scss);
</style>
